<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>商品详情</title>
    <link rel="stylesheet" href="../../css/wxq.css">
    <link rel="stylesheet" href="../../css/base.css">
    <link rel="stylesheet" href="../../font/css/font-awesome.min.css">
    <style>
        .set-freight{margin: 5px auto}
        .set-freight input{max-width: 80px!important;}
        #attr_submit{padding: 0px 20px;background-color: #396189;color: #fff;border-color:#396189 ;cursor: pointer}
    </style>
</head>
<body>

<!--头部公共样式-->
<header class="header">
    <div class = "logo float_left"><a href="../index/index.html">后台管理系统</a></div>
    <div class = "header_right">
        <nav>
            <ul>

                <li>
                    <a title="更多"><i class = "fa fa-navicon"></i></a>
                    <ul class="dropdown_menu">
                        <li id = "logout">&nbsp;<i class = "fa fa-sign-out"></i>&nbsp;退出</li>
                    </ul>
                </li>
                <li>
                    <a href="../message/messages.html" title = "消息"><i class = "fa fa-envelope"></i></a>
                    <span class="message_count"></span>
                </li>
            </ul>
        </nav>
        <div class = "message_warp_info"></div>
    </div>
</header>

<div class="container">

    <!--左边导航区-->
    <div class="slide" id ="slide">

        <!--左边管理员信息区域-->
        <div class = "admin_info">
            <a href="#" class = "admin_header_img">
                <img src="../../images/test_header.png" alt="">
                <div class = "upload_header_img">更换</div>
            </a>
            <div class = "admin_detail">
                <span class = "admin_type">超级管理员</span>
                <span class = "admin_name">王小强</span>
            </div>
        </div>

        <!--左边导航按钮区域-->
        <ul class = "menu" >
            <li>
                <a href="../index/index.html" class="super_menu">
                    <i class="fa fa-home"></i>&nbsp;&nbsp;首页
                </a>
            </li>
            <li>
                <a class="super_menu">
                    <i class="fa fa-gears"></i>&nbsp;&nbsp;系统配置<i class="fa fa-angle-right"></i>
                </a>
                <ul class = "menu_child_list" >
                    <li>
                        <a href="../conf/bannerSetting.html">
                            <i class="fa fa-image"></i>&nbsp;&nbsp;banner管理
                        </a>
                    </li>
                </ul>
            </li>

            <li>
                <a class="super_menu">
                    <i class="fa fa-users"></i>&nbsp;&nbsp;用户管理<i class="fa fa-angle-right"></i>
                </a>
                <ul class = "menu_child_list isSuper" >
                    <li>
                        <a href="../user/userList.html">
                            <i class="fa fa-user"></i>&nbsp;&nbsp;用户列表
                        </a>
                    </li>
                    <li>
                        <a href="../member/memberManagement.html">
                            <i class="fa fa-user-plus"></i>&nbsp;&nbsp;会员管理
                        </a>
                    </li>
                    <li>
                        <a href="../member/integralSetting.html">
                            <i class="fa fa-vcard"></i>&nbsp;&nbsp;积分设置
                        </a>
                    </li>
                </ul>
            </li>
            <li>
                <a class="super_menu active">
                    <i class="fa fa-cart-plus"></i>&nbsp;&nbsp;商城管理<i class="fa fa-angle-right"></i>
                </a>
                <ul class = "menu_child_list isSuper" style="display: block">
                    <li>
                        <a href="../category/goodsCategory.html">
                            <i class="fa fa-bar-chart"></i>&nbsp;&nbsp;商品分类
                        </a>
                    </li>
                    <li>
                        <a href="../freight/freightTemplate.html">
                            <i class="fa fa-cart-arrow-down"></i>&nbsp;&nbsp;运费模板
                        </a>
                    </li>
                    <li>
                        <a href="goodsList.html">
                            <i class="fa fa-list"></i>&nbsp;&nbsp;商品列表
                        </a>
                    </li>
                    <li>
                        <a href="../order/orderList.html">
                            <i class="fa fa-first-order"></i>&nbsp;&nbsp;订单管理
                        </a>
                    </li>
                </ul>
            </li>
            <li>
                <a href="../message/messages.html" class="super_menu">
                    <i class="fa fa-comment"></i>&nbsp;&nbsp;消息管理
                </a>
            </li>
            <li>
                <a href="../index/dataStatistics.html" class="super_menu">
                    <i class="fa fa-signal"></i>&nbsp;&nbsp;数据统计
                </a>
            </li>
            <li>
                <a href="../admin/authoritySetting.html" class="super_menu">
                    <i class="fa fa-unlock"></i>&nbsp;&nbsp;权限管理
                </a>
            </li>
        </ul>
    </div>

    <div class="main_content">

        <div class="warp">
            <div class = "position">
                <span>当前位置：</span>
                <span>
                    <a>商城管理/</a>
                    <a href="goodsList.html">商品列表/</a>
                    <a href="goodsDetail.html">商品详情</a>
                </span>
            </div>
        </div>

        <div class="warp">
            <div class = "form" id = "update_goods">
                <div class = "form_item">
                    <label for="goods_name" class="form_label">商品名称</label>
                    <div class = "input_div_block input_t_single">
                        <input type="text" id="goods_name" placeholder="商品名称" :value = "resources.goodsDetail.goods_name" class = "form_input">
                    </div>
                </div>
                <div class = "form_item">
                    <label for="cat_id" class="form_label">商品分类</label>
                    <div class = "input_div_block input_t_single set_height" >
                        <div class = "input_div_block">
                            <select class="form_input" id = "cat_id" >

                            </select>
                        </div>
                    </div>
                </div>

                <div class = "form_item">
                    <label for="goods_sn" class="form_label">商品货号</label>
                    <div class = "input_div_block input_t_single">
                        <input type="text" id="goods_sn" placeholder="商品货号" :value = "resources.goodsDetail.goods_sn" class = "form_input">
                    </div>
                </div>

                <div class = "form_item">
                    <label for="goods_number" class="form_label">商品库存</label>
                    <div class = "input_div_block input_t_single">
                        <input type="text" id="goods_number" placeholder="商品库存" :value = "resources.goodsDetail.goods_number" class = "form_input">
                    </div>
                </div>

            <!--    <div class = "form_item">
                    <label for="goods_weight" class="form_label">商品重量</label>
                    <div class = "input_div_block input_t_single">
                        <input type="text" id="goods_weight" placeholder="商品重量" :value = "resources.goodsDetail.goods_weight" class = "form_input">
                    </div>
                </div>-->
                <div class = "form_item">
                    <label for="price" class="form_label">一般价格</label>
                    <div class = "input_div_block input_t_single">
                        <input type="text" id="price" placeholder="一般价格" :value = "resources.goodsDetail.price" class = "form_input">
                    </div>
                </div>
                <div class = "form_item">
                    <label for="member_price" class="form_label">会员价格</label>
                    <div class = "input_div_block input_t_single">
                        <input type="text" id="member_price" placeholder="会员价格" :value = "resources.goodsDetail.member_price" class = "form_input">
                    </div>
                </div>

                <div class = "form_item">
                    <label for="member_price" class="form_label">上下架</label>
                    <div class = "input_div_block input_t_single set_height" >
                        <div class = "input_div_block">
                            <select class="form_input" id = "is_shelve" >
                                <option v-if="resources.goodsDetail.is_shelve === true">上架</option>
                                <option v-else>下架</option>
                            </select>
                        </div>
                    </div>
                </div>

                <div class = "form_item">
                    <label for="member_price" class="form_label">热门商品</label>
                    <div class = "input_div_block input_t_single">
                        <input type="number" id="hot_sort" min="0" :value = "resources.goodsDetail.hot_sort" placeholder="0(0表示非热门商品,数值越大热度越高)"  class = "form_input">
                    </div>
                </div>

                <div class = "form_item">
                    <label for="goods_brief" class="form_label">商品简短描述</label>
                    <div class = "input_div_block input_t_single">
                        <input type="text" id="goods_brief" placeholder="商品简短描述" :value = "resources.goodsDetail.goods_brief" class = "form_input">
                    </div>
                </div>

                <!--<div class = "form_item">
                    <label for="goods_desc" class="form_label">商品详细信息</label>
                    <div class = "input_div_block input_t_single">
                        <textarea  id="goods_desc" placeholder="商品详细信息" :value = "resources.goodsDetail.goods_desc" class = "form_textarea" ></textarea>
                    </div>
                </div>-->

                <div class = "form_item">
                    <label for = "pic_main" class="form_label">商品代表图</label>
                    <div class = "input_div_block input_t_single">
                        <label for="pic_main" class = "form_input file_over"><span>选择图片</span></label>
                        <input type="file" id = "pic_main" v-on:change="uploadMainImg" class = "form_input hidden">
                        <div class = "input_div_block" >
                            <span style="display: inline-block" v-for = "(item , index) in resources.mainImg">
                                <img width='100' style = 'margin:10px 10px 10px 0px;max-height: 80px' :src = 'resources.imgPath+item'/>
                                <span class="cursor_p" style="display: block ;text-align: center" img_type = "main_img" @click = "deleteAttrItem" :item_index = "index">删除</span>
                            </span>
                        </div>
                    </div>
                </div>

                <div class = "form_item">
                    <label for="pic_banner" class="form_label">商品轮播图片</label>
                    <div class = "input_div_block input_t_single">
                        <label for="pic_banner" class = "form_input file_over"><span>选择图片</span></label>
                        <input type="file" id = "pic_banner" v-on:change="uploadBannerImg" class = "form_input hidden" multiple >
                        <div class = "input_div_block" >
                            <span style="display: inline-block" v-for = "(item , index) in resources.bannerImg">
                                <img width='100' style = 'margin:10px 10px 10px 0px;max-height: 80px' :src = 'resources.imgPath+item'/>
                                <span class="cursor_p" style="display: block ;text-align: center" img_type = "banner_img" @click = "deleteAttrItem" :item_index = "index">删除</span>
                            </span>
                        </div>
                    </div>
                </div>

                <div class = "form_item">
                    <label for="seller_note" class="form_label">卖家留言</label>
                    <div class = "input_div_block input_t_single">
                        <input type="text" id="seller_note" placeholder="卖家留言" :value = "resources.goodsDetail.seller_note" class = "form_input">
                    </div>
                </div>

              <!--  <div class = "form_item">
                    <label for="freight_id" class="form_label">运费模板</label>
                    <div class = "input_div_block input_t_single set_height" >
                        <div class = "input_div_block">
                           <select class="form_input" id = "freight_id" >

                            </select>

                        </div>
                    </div>
                </div>
-->
                <div class = "form_item">
                    <label class="form_label">规格设置</label>
                    <div class = "input_div_block input_t_single set_height" >
                        <div class = "input_div_block set-freight">
                            <select class="form_inline" id = "attr_class">
                                <option v-for = "item in resources.attrClassList" v-text = "item.name" :value = "item.id"></option>
                            </select>

                            <span>&nbsp;规格名</span>
                            <input type="text" id="attr_name"  class = " form_inline">

                            <span>&nbsp;增长价格</span>
                            <input type="text" id="increase_price"  class = " form_inline">

                            <span>&nbsp;规格描述</span>
                            <input type="text" min="0" id="attr_desc"  class = " form_inline">

                            <span>&nbsp;数量</span>
                            <input type="text" min="0" id="attr_number"  class = " form_inline">

                            <div class = "input_div_block input_div_inline">
                                <input type="file" id = "attr_img" class = "form_input hidden">
                                <label for="attr_img" class = "form_input file_over">选择图片</label>
                            </div>

                            <button class="form_inline" id = "attr_submit" @click = "addAttr"><i class="fa fa-plus"></i></button>
                        </div>
                        <div class = "input_div_block set-freight">
                            <table class="table table_border_bottom">
                                <thead>
                                <tr v-if="resources.attrList.length !== 0">
                                    <th>规格类别</th>
                                    <th>规格名</th>
                                    <th>增长价格</th>
                                    <th>规格描述</th>
                                    <th>商品数量</th>
                                    <th>图片</th>
                                    <!--<th>删除</th>-->
                                </tr>
                                </thead>
                                <tbody>
                                <tr v-if = "resources.attrList.length>0" v-for = "(item,index) in resources.attrList">
                                    <td v-text = "item.attr_class_object.name"></td>
                                    <td v-text = "item.attr_name"></td>
                                    <td v-text = "item.increase_price"></td>
                                    <td v-text = "item.attr_desc"></td>
                                    <td v-text = "item.attr_number"></td>
                                    <td v-if = "item.attr_img"><img :src="resources.imgPath+item.attr_img" width="35" height="35"></td>
                                    <td v-else></td>
                                    <!--暂时屏蔽删除功能-->
                                    <!--<th><a class = "cursor_p"  @click = "deleteAttrItem" img_type = "attr_img" :item_index = "index">删除</a></th>-->
                                </tr>
                                </tbody>
                            </table>
                        </div>
                    </div>
                </div>

                <div class = "form_item">
                    <label for="submit" class="form_label"></label>
                    <div class = "input_div_block input_t_single" >
                        <button class="btn btn_default" @click = "updateGoods" id = "submit">提交</button>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
<script src = "../../js/jquery-3.2.1.min.js"></script>
<script src="../../my_js/sockjs.min.js"></script>
<script src="../../my_js/stomp.min.js"></script>
<script src = "../../my_js/common.js"></script>
<script src = "../../js/wxq.js"></script>
<script src = "../../js/vue.min.js"></script>
<script src = "../../js/nicevalidate.js"></script>
<script src = "../../my_js/goodsDetail.js"></script>
</body>
</html>